#ifndef __CM_MEDIA_S3C6410_CAMERA_SOURCE_FILTER_H__
#define __CM_MEDIA_S3C6410_CAMERA_SOURCE_FILTER_H__

#include "SourceFilter.h"
#include "MediaTask.h"
#include "Poco/Timer.h"
#include "MediaFramePool.h"
#include "OutputPin.h"

using namespace Poco;

namespace cm_media
{
    class CaptureTimerNotification: public BaseNotification
    {
    public:
        CaptureTimerNotification(): BaseNotification(NotificationTypeOnCaptureTimer)
        {

        }
    };

    class S3C6410CameraSourceFilter: public SourceFilter, public MediaTask
    {
    public:
        S3C6410CameraSourceFilter();
        ~S3C6410CameraSourceFilter();

        int setup();
        int teardown();

        int enqueueBuffer( ByteBuffer*p_buffer );
    //protected:
        void run();
        void startCaptureTimer(long milliseconds);
        void stopCaptureTimer();
        void cbCaptureTimer(Timer& timer);

    private:
        MediaFramePool* m_pool;
        Timer m_timer;
        bool m_stopFlag;
        bool m_captureTimerInitd;

        OutputPin* m_outputPin;

    };
}

#endif